<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>DOM operation exercise</title>
</head>
<script src="dom.js"></script>
<script>

    var t;
    domReady(function () {
        var m = document.getElementById('msg');
        m.innerHTML += "domReady is loaded";
        var t1 = (new Date()).getTime();
        t = t1;
        m.innerHTML += " consume time: " + t1;
    });
    window.onload = function () {
        var m = document.getElementById('msg2');
        m.innerHTML += "  onload is loaded";
        var t2 = (new Date()).getTime();
        m.innerHTML += '  consume time: ' + t2 + ":" + (t2 - t);
    }
</script>
<body>

<p id="msg"></p>

<p id="msg2"></p>
<p>
    <img src="DSCN0216.JPG">
</p>
</body>
</html>